import { WIN_MAIN_RENDERER_EVENT_NAME } from '@common/ipcNames';
import { mainHandle } from '@common/mainIpc';
import {
  getTextMarkInfoQuery,
  getTextMarkInfoQueryCount,
  deleteMark,
  selectVideoListByIds,
} from '@main/core/sqlite/modules/text_mark_manage';

export default () => {
  mainHandle<any>(WIN_MAIN_RENDERER_EVENT_NAME.getTextMarkInfoQuery, async (data: any) => {
    return await getTextMarkInfoQuery(data.params);
  });

  mainHandle<any>(WIN_MAIN_RENDERER_EVENT_NAME.getTextMarkInfoQueryCount, async (data: any) => {
    return await getTextMarkInfoQueryCount(data.params);
  });

  mainHandle<any>(WIN_MAIN_RENDERER_EVENT_NAME.deleteMark, async (data: any) => {
    return await deleteMark(data.params);
  });

  mainHandle<any>(WIN_MAIN_RENDERER_EVENT_NAME.selectVideoListByIds, async (data: any) => {
    return await selectVideoListByIds(data.params.ids);
  });
};
